Skip to content

fix: restrict docs-preview workflow to actual docs changes#515

Merged
andreatgretel merged 3 commits intomainfrom
andreatgretel/fix/docs-preview-path-filter
Apr 9, 2026
Merged

fix: restrict docs-preview workflow to actual docs changes#515
andreatgretel merged 3 commits intomainfrom
andreatgretel/fix/docs-preview-path-filter

Conversation

@andreatgretel
Copy link
Copy Markdown
Contributor

@andreatgretel andreatgretel commented Apr 9, 2026

📋 Summary

The docs-preview workflow had an overly broad path filter (packages/*/src/data_designer/**) that triggered on every source code change. This caused unnecessary Cloudflare Pages deployments on code-only PRs (e.g. #505) where no docs content changed.

🔗 Related Issue

N/A

🔄 Changes

  • Remove the packages/*/src/data_designer/** path filter from the docs-preview.yml workflow trigger
  • The workflow now only runs when docs/**, mkdocs.yml, or the workflow file itself changes

🧪 Testing

  • make test passes - N/A, no testable logic
  • Verify the workflow does not trigger on a code-only PR
  • Verify the workflow does trigger on a PR touching docs/

✅ Checklist

  • Follows commit message conventions
  • Commits are signed off (DCO)
  • Architecture docs updated - N/A

The docs-preview workflow triggered on all source code changes due to
the broad `packages/*/src/data_designer/**` path glob. This caused
unnecessary Cloudflare Pages deployments on code-only PRs like #505.

Remove the source code path filter so the workflow only triggers on
actual docs content changes (docs/**, mkdocs.yml, and the workflow
file itself).
@andreatgretel andreatgretel requested a review from a team as a code owner April 9, 2026 12:36
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 9, 2026

Greptile Summary

Removes the packages/*/src/data_designer/** path filter from the docs-preview workflow so it no longer fires on pure code-only PRs. The fix is correct in motivation but slightly over-broad: mkdocs.yml uses mkdocstrings to auto-generate the Code Reference section from those same source directories, so docstring-only PRs will no longer receive a preview either.

Confidence Score: 4/5

Safe to merge after considering whether docstring-only PRs should still trigger a preview.

The change achieves its stated goal correctly, but the mkdocstrings-backed Code Reference section means source file changes do affect rendered docs — a narrower path filter would preserve that coverage. This is a P2 workflow-behavior gap, not a production defect, but the finding describes a real omission in trigger logic.

.github/workflows/docs-preview.yml — review whether mkdocstrings source paths should be re-added with a tighter glob.

Vulnerabilities

No security concerns identified.

Important Files Changed

Filename Overview
.github/workflows/docs-preview.yml Removes packages/*/src/data_designer/** from path triggers; correct intent but over-broad — mkdocstrings-generated API reference pages are still sourced from those directories.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    PR[Pull Request opened / synchronized] --> PathCheck{Path filter match?}
    PathCheck -->|docs/** changed| Trigger[Run docs-preview workflow]
    PathCheck -->|mkdocs.yml changed| Trigger
    PathCheck -->|.github/workflows/docs-preview.yml changed| Trigger
    PathCheck -->|packages/ source changed ONLY| Skip[Workflow skipped]
    Trigger --> Build[Build MkDocs site]
    Build --> Deploy[Deploy to Cloudflare Pages]
    Deploy --> Comment[Post preview URL comment on PR]
    Skip --> NoPreview[No preview generated]
    style Skip fill:#f96,color:#000
    style NoPreview fill:#f96,color:#000
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: .github/workflows/docs-preview.yml
Line: 3-9

Comment:
**Source-code docstring changes no longer trigger a preview**

`mkdocs.yml` configures `mkdocstrings` to render the entire **Code Reference** section directly from docstrings in `packages/*/src/data_designer/**`, and its `watch` block lists the same paths. A PR that only updates a docstring, adds a new public class, or renames a parameter will no longer receive a Cloudflare preview, so reviewers won't be able to inspect the rendered API reference change in the PR.

Consider re-adding a narrower path that targets only the source files most likely to affect rendered output, for example:

```yaml
- "packages/*/src/data_designer/**/*.py"
```

That still prevents the broader infra/test churn from triggering previews while keeping the mkdocstrings-backed pages covered.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (3): Last reviewed commit: "Merge branch 'main' into andreatgretel/f..." | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Docs preview: https://e651afbe.dd-docs-preview.pages.dev

Notebook tutorials are placeholder-only in previews.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Review: PR #515 — fix: restrict docs-preview workflow to actual docs changes

Summary

This single-line PR removes the packages/*/src/data_designer/** glob from the paths trigger in .github/workflows/docs-preview.yml. The stated goal is to stop code-only PRs from wastefully triggering a full docs preview build + Cloudflare Pages deploy.

Changed files: 1 (.github/workflows/docs-preview.yml — 0 additions, 1 deletion)

Findings

1. [Medium] Docs build depends on source code via mkdocstrings

The mkdocstrings plugin is configured in mkdocs.yml to render API reference pages from Python docstrings located under packages/*/src/:

- mkdocstrings:
    handlers:
      python:
        paths:
          - packages/data-designer-config/src
          - packages/data-designer-engine/src
          - packages/data-designer/src

There are 12+ API reference pages in docs/code_reference/ that use ::: data_designer.* autodoc directives. When a PR modifies a public docstring, function signature, or class definition in the source packages, the rendered API reference will change — but with this filter removed, no docs preview will be generated for those PRs.

This means a contributor changing a public API surface (renaming a parameter, updating a docstring, removing a class) will not get a docs preview showing the impact on the published reference docs. The previous broad filter was over-inclusive (it fired on any source change, not just public API changes), but removing it entirely swings to under-inclusive.

Suggestion: Consider a narrower filter that still covers the API-surface files. For example:

- "packages/*/src/data_designer/**/config_builder.py"
- "packages/*/src/data_designer/**/column_configs.py"
- "packages/*/src/data_designer/config/**"

Or accept the trade-off and document that contributors should manually trigger a docs preview (or check locally) when changing public APIs.

2. [Low] No follow-up for local docs verification guidance

The PR description's test plan covers CI trigger behavior but doesn't mention updating contributor docs (e.g., DEVELOPMENT.md or CONTRIBUTING.md) to note that source-code changes affecting API docs now require manual mkdocs build verification. This is minor — contributors familiar with the project likely know this — but worth noting for completeness.

3. [Info] The change itself is correct and safe

The YAML syntax is valid. The remaining path filters (docs/**, mkdocs.yml, .github/workflows/docs-preview.yml) are the right set for pure-docs changes. The deletion does not affect any other workflow or job.

Verdict

Approve with comment. The change is correct for its stated goal (stop code-only PRs from triggering docs builds) and is low-risk. However, the mkdocstrings dependency on source files means API-reference accuracy in previews will regress for source-only PRs. The team should make a deliberate call on whether that trade-off is acceptable or whether a narrower path filter targeting public API modules would be preferable.

@andreatgretel andreatgretel merged commit 13cd687 into main Apr 9, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants